<template>
  <div class="customtitle_container" @click="click()" :class="[isAutoMargin ? 'marginb-15' : '', isLine ? 'line' : '', BgIsNone ? 'none' : '']">
    <div class="title-wrapper">
      <template v-if="showLogo">
        <img src="@/assets/images/home/titlogo.png" />
      </template>
      <span class="title" :class="[prefixClass, fontSet]">
        <slot name="prefixClass"></slot>
        {{ title }}
      </span>
      <slot name="describe"></slot>
    </div>
    <div class="utils position-r">
      <slot name="utils"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'smalltitle',
  props: {
    title: {
      type: String,
      default: '标题',
    },
    showLogo: {
      type: Boolean,
      default: true
    },
    prefixClass: {
      type: String,
      default: 'before',
    },
    isAutoMargin: {
      type: Boolean,
      default: true
    },
    isLine: {
      type: Boolean,
      default: false
    },
    BgIsNone: {
      type: Boolean,
      default: false
    },
    fontSet:{
      type: String,
      default: () => {
        return 'font1'
      }
    }
  },
  methods: {
    click () {
      this.$emit('click', this.title)
    },
  },
}
</script>

<style lang="less" scoped>
.customtitle_container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  box-sizing: content-box;
  background-image: url("@/assets/images/home/titbg.png"),
    url("@/assets/images/home/1.png");
  background-position: left top, 800px top;
  background-size: 800px 35px, calc(100% - 800px) 35px;
  background-repeat: no-repeat;
  font-size: 16px;
  min-height: 35px;
  .title-wrapper {
    img {
      width: 30px;
      height: 22px;
    }
    .title {
      line-height: 35px;
      padding-left: 6px;
      color: #ffffff;
      position: relative;
      white-space: nowrap;
    }
  }
}

.customtitle_container.line{
  background-image: unset;
  position: relative;
  &::after{
    content: '';
    display: block;
    width: 90%;
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,.8));
    margin-top: 17px;
    position: absolute;
    right: 0;
  }
  &::before{
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 50%;
    margin-top: 17px;
    position: absolute;
    right: -5px;
    top: -2px;
  }
}
.customtitle_container.none{
  &::after,
  &::before{
    display: none;
  }
}

.title.font1{
  font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
    font-size: 16px;
    background: linear-gradient(to bottom, #FCFEFF 36%, #126475 86%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
</style>
